Skip to content

Instantly share code, notes, and snippets.

@simonw
simonw / recover_source_code.md
Last active May 18, 2024 01:57
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@Vendicated
Vendicated / ids.txt
Last active May 18, 2024 01:54
spy pet account ids, gathered by @Dziurwa14. be careful, their api now returns innocent people. don't get tricked into banning the wrong people. do not trust their api and double check before banning
1210165420493905982
956054319529066527
956075132571508757
1171196139647803513
956210819325132921
956164930061619230
1185038257789079614
956246550152118374
956178931512410222
1172076548791226439
@agentlame
agentlame / comskip.ini
Created November 12, 2018 14:55
Default comskip file for Plex Media Server
; See comskip.txt in the distribution zip file for many settable parameters, read manual.html, tuning.html and debugwindow.html for how to tune and debug comskip
detect_method=43 ; 1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 16=closed captions, 32=aspect ration, 64=silence, 128=cutscenes, 255=all
validate_silence=1 ; Default, set to 0 to force using this clues if selected above.
validate_uniform=1 ; Default, set to 0 to force using this clues (like pure white frames) if blackframe is selected above.
validate_scenechange=1 ; Default, set to 0 to force using this clues if selected above.
verbose=10 ; show a lot of extra info, level 5 is also OK, set to 0 to disable
max_brightness=60 ; frame not black if any pixels checked are greater than this (scale 0 to 255)
test_brightness=40 ; frame not pure black if any pixels checked are greater than this, will check average brightness (scale 0 to 255)
max_avg_brightness=25 ; maximum average brightness for
@Khalmatov
Khalmatov / config-nginx-gunicorn+django
Created March 3, 2021 11:35
Настройка NGINX + Gunicorn + Django
Подготовка:
Установка всех пакетов:
sudo apt update
sudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl
Создание виртуальной среды:
sudo pip3 install virtualenv
mkdir ~/myprojectdir
cd ~/myprojectdir
@craig-m
craig-m / README.md
Last active May 18, 2024 01:49
Packer Vagrant VirtualBox Ubuntu 22.04 install with Cloud-Init

Ubuntu Packer VirtualBox

A simple Packer + Vagrant VirtualBox install of Ubuntu live-server 22.04 (x86) using Cloud-Init, and documentation of my host desktop.

host setup

A fresh install of any supported LTS or the latest Ubuntu desktop version is good. I have tested this on ubuntu 18.04.6 running on an i5-4570 (4 core 3.20GHz) with 16GB of RAM, a nearly 10 year old computer. Get a dedicated machine, it need not be fancy or new.

Update and get setup with some tools + deps first:

@varenc
varenc / README.md
Last active May 18, 2024 01:42
Keep your Mac from waking by disabling the `InternalPreventSleep` assertion from `com.apple.powermanagement.acwakelinger`

Disable AC Wake lingering in macOS using undocumented pmset features

Every time your Mac wakes from sleep powerd creates an InternalPreventSleep assertion labeled com.apple.powermanagement.acwakelinger with a 45 second timeout. That assertion ensures that even if your Mac needs to wake for 2 seconds to recieve a push notification that it stays on for 45 seconds. Seemingly there's no way to control this. And recent versions of macOS love to wake quite frequently.

Forunately we can disable this. The built in pmset tool has many undocumented features but thankfully it's open source

Cruicially there's an undocumented pmset disabledassertion feature that just makes macOS ignore certain power assertions. To effectively disable acwakelinger we just run this:

$ sudo pmset disableassertion InternalPreventSleep
@veekaybee
veekaybee / normcore-llm.md
Last active May 18, 2024 01:40
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@kayabaNerve
kayabaNerve / deanon_dero.md
Created May 17, 2024 14:53
Deanonymization of the Dero Network

The Dero Protocol

The protocol uses a pair of rings, one for the senders, one for the receivers, represented as a singular ring. With each transfer, a list of ElGamal ciphertexts is provided for all accounts within the joint ring. This ElGamal ciphertext is formed as r * G, (r * K) + (a * G), where r is some randomness, K is the key for the account the ciphertext is for, and a is the amount.

The Dero Wallet Protocol

Dero offers an 'encrypted message' with every transaction. Even if the user does not explicitly provide one, a message will exist (either with internally provided values or left empty). For the only defined type of message, the message is encoded as the index of the sender, a CBOR-encoded object, and zero-padding. The message is encrypted with the Chacha20 stream created by a key of H(H(r * K) || K) where r is some randomness and K is the key for the account the ciphertext is for.

The Issue

@ww9
ww9 / gist_markdown_examples.md
Last active May 18, 2024 01:30
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these: